import request from '@/utils/request'

export function getByCode(caseCode) {
    return request({
        url: '/web-api/api/acceptCases/findByCode',
        method: 'get',
        params: { caseCode: caseCode }
    })
}

export function getList(query) {
    return request({
        url: '/web-api/api/acceptCases',
        method: 'get',
        params: query
    })
}

export function add(data) {
    return request({
        url: '/web-api/api/acceptCases',
        method: 'post',
        data
    })
}

export function del(ids) {
    return request({
        url: '/web-api/api/acceptCases/',
        method: 'delete',
        data: ids
    })
}

export function edit(data) {
    return request({
        url: '/web-api/api/acceptCases',
        method: 'put',
        data
    })
}

export const downloadUrl = '/web-api/api/acceptCases/download'

// 指派
export function addAssignTask(data) {
    return request({
        url: '/web-api/api/assignTask',
        method: 'post',
        data
    })
}
// 查询指派
export function getAssignTaskByCaseId(id) {
    return request({
        url: '/web-api/api/assignTask',
        method: 'get',
        params: {
            caseId: id
        }
    })
}
// 查询案件记录
export function getFlowRByCaseCode(query) {
    return request({
        url: '/web-api/api/flowRecord/list',
        method: 'get',
        params: query
    })
}

// 查询指派
export function getAssignTaskById(id) {
    return request({
        url: '/web-api/api/assignTask/findById?id=' + id,
        method: 'get'
    })
}

// 来源类型
export function SourceTypeTest(query) {
    return request({
        url: 'http://192.168.1.34:8080/dev-api/system/case/getBasicList?sysGroup=caseFrom',
        method: 'get',
        params: query
    })
}